package com.qf.pojo.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName Resultmsg
 * @Description
 * @Author lanzhike
 * @Date 2023/7/25 17:18
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Resultmsg {

    private Integer code;
    private String msg;
    private Object data;
    private Integer total;

    public static Resultmsg success(){
      return new Resultmsg(200,"操作成功",null,null);
    }
    public static Resultmsg success(Object data){
        return new Resultmsg(200,"操作成功",data,null);
    }
    public static Resultmsg success(Object data,Integer total){
        return new Resultmsg(200,"操作成功",data,total);
    }
    public static Resultmsg fail(String msg){
        return new Resultmsg(400,msg,null,null);
    }
}
